var a = require("../../@babel/runtime/helpers/interopRequireDefault"), e = a(require("../../@babel/runtime/regenerator")), t = require("../../@babel/runtime/helpers/asyncToGenerator"), o = a(require("../../utils/logs")), n = require("../payKeyboard/PayKeyboardAsync"), r = getApp();

module.exports = Behavior({
    data: {
        confirmPayText: "确定",
        popupSpecs: !1,
        isPayClick: !1,
        pageTag: ""
    },
    observers: {
        buttons: function (a) {
            var e = this;
            a && a.constructor === Array && a.length > 0 && a.map(function (a) {
                54 == a.value && e.setData({
                    confirmPayText: a.name || "确定"
                });
            });
        }
    },
    methods: {
        hanleIcon: function (a) {
            var e = [];
            for (var t in a.buttons) "wechatPay" == a.buttons[t].code || "wechatMinPay" == a.buttons[t].code || "cloudPayWechat" == a.buttons[t].code || "wechatApp" == a.buttons[t].code || "yunPayWechat" == a.buttons[t].code || "yop" == a.buttons[t].code || "convergePayWechat" == a.buttons[t].code || "WechatScan" == a.buttons[t].code || "WechatFace" == a.buttons[t].code || "WechatJsapi" == a.buttons[t].code || "wechatAggregatePay" == a.buttons[t].code || "leshuaWechat" == a.buttons[t].code ? (a.buttons[t].icon = "icon-pay_wechat",
                a.buttons[t].color = "#09bb07") : "MemberCard" == a.buttons[t].code || "balance" == a.buttons[t].code ? (a.buttons[t].icon = "icon-pay_yue",
                    a.buttons[t].color = "#ff7433") : "anotherPay" == a.buttons[t].code ? (a.buttons[t].icon = "icon-pay_otherpay",
                        a.buttons[t].color = "#ffba00") : "UsdtPay" == a.buttons[t].code ? (a.buttons[t].icon = "icon-pay_utsd",
                            a.buttons[t].color = "#9000ff") : "DepositPay" == a.buttons[t].code ? (a.buttons[t].icon = "icon-pay_prepay",
                                a.buttons[t].color = "#9000ff") : "COD" == a.buttons[t].code ? (a.buttons[t].icon = "icon-pay_cashondelivery",
                                    a.buttons[t].color = "#ed3800") : "convergeQuickPay" == a.buttons[t].code ? (a.buttons[t].icon = "icon-pay_quick",
                                        a.buttons[t].color = "#46e0d1") : "remittance" == a.buttons[t].code ? (a.buttons[t].icon = "icon-pay_remittance",
                                            a.buttons[t].color = "#ff7433") : "alipay" == a.buttons[t].code || "cloudPayAlipay" == a.buttons[t].code || "alipayApp" == a.buttons[t].code || "yunPayAlipay" == a.buttons[t].code || "wftAlipay" == a.buttons[t].code || "convergePayAlipay" == a.buttons[t].code || "yopAlipay" == a.buttons[t].code || "AlipayScan" == a.buttons[t].code || "AlipayFace" == a.buttons[t].code || "AlipayJsapi" == a.buttons[t].code || "alipayAggregatePay" == a.buttons[t].code ? (a.buttons[t].icon = "icon-pay_alipay",
                                                a.buttons[t].color = "#29a1f7") : "parentPayment" == a.buttons[t].code ? (a.buttons[t].icon = "icon-fontclass-daifu1",
                                                    a.buttons[t].color = "#f15353") : "dcmScanPay" == a.buttons[t].code ? (a.buttons[t].icon = "icon-fontclass-saomazhifu",
                                                        a.buttons[t].color = "#f4a556") : (a.buttons[t].icon = "icon-pay_default", a.buttons[t].color = "#538ff9"),
                e.push(t);
        },
        btnclass: function (a) {
            return console.log(a, "3232"), 1 == a || 55 == a || 6 == a || 9 == a || 12 == a || 20 == a || 22 == a || 28 == a ? "icon-balance_i" : 2 == a || 10 == a ? "icon-balance_j" : 18 == a ? "icon-balance_d" : 19 == a ? "icon-balance_g" : "icon-balance_h";
        },
        rechargePay: function (a, o, n, r) {
            var s = arguments, i = this;
            return t(e.default.mark(function t() {
                var c, d, u, p, l;
                return e.default.wrap(function (e) {
                    for (; ;) switch (e.prev = e.next) {
                        case 0:
                            if (c = s.length > 4 && void 0 !== s[4] ? s[4] : "", d = {}, 1 != a && 55 != a && 48 != a) {
                                e.next = 10;
                                break;
                            }
                            u = {}, u = "credit" === r ? o : o.data.config, console.log(u), d = {
                                timestamp: u.timestamp,
                                nonceStr: u.nonceStr,
                                package: u.package,
                                signType: u.signType,
                                paySign: u.paySign
                            }, i.WXPay_other(d, "back"), e.next = 30;
                            break;

                        case 10:
                            if (3 != a) {
                                e.next = 29;
                                break;
                            }
                            if (console.log(a), console.log(r), "tourAroundPay" !== r) {
                                e.next = 25;
                                break;
                            }
                            if (console.log(c.need_password), 1 != c.need_password) {
                                e.next = 23;
                                break;
                            }
                            return i.setData({
                                popupSpecs: !0,
                                payarr: "",
                                isclick: !1
                            }), e.next = 19, i.getPayKeyboardPassword();

                        case 19:
                            p = e.sent, i.getVerifyPassword(p, "tourAround", a), e.next = 24;
                            break;

                        case 23:
                            wx.redirectTo({
                                url: "/packageI/pay_back/pay_back?name=tourAround&ids=".concat(i.data.order_pay_id, "&sn=").concat(i.data.order_sn)
                            });

                        case 24:
                            return e.abrupt("return");

                        case 25:
                            "clock" === r && (i._getTodayClockOn(), i._getCurrentPayStatus()), wx.showToast({
                                title: o.msg || "支付成功",
                                icon: "none",
                                duration: 1500,
                                success: function () {
                                    setTimeout(function () {
                                        wx.navigateBack({
                                            delta: 1
                                        });
                                    }, 1500);
                                }
                            }), e.next = 30;
                            break;

                        case 29:
                            28 == a ? "credit" === r ? i.HJWXPay({
                                appId: o.appId,
                                timeStamp: o.timeStamp,
                                nonceStr: o.nonceStr,
                                package: o.package,
                                signType: o.signType,
                                paySign: o.paySign
                            }) : "成功" == o.data.msg ? (l = JSON.parse(o.data.data.rc_Result), d = {
                                appId: l.appId,
                                timeStamp: l.timeStamp,
                                nonceStr: l.nonceStr,
                                package: l.package,
                                signType: l.signType,
                                paySign: l.paySign
                            }, i.HJWXPay(d, "noRect")) : wx.showToast({
                                title: o.data.msg,
                                icon: "none"
                            }) : 33 == a ? i.jueqiAlipay(n) : 86 == a ? i.WXPay_other(o.data.pay_msg) : 102 == a ? i.WXPay_other(o.data) : 59 == a ? i.rechargePay_quick_pay(n, r) : 78 == a ? i.HJWXPay(o.data.pay_msg.js_prepay_info) : 82 == a ? i.WXPay_other(o.data.pay_msg.js_prepay_info) : wx.showToast({
                                title: "暂不支持该支付方式",
                                icon: "none"
                            });

                        case 30:
                        case "end":
                            return e.stop();
                    }
                }, t);
            }))();
        },
        handleOtherPay: function (a, o, n, r) {
            var s = this;
            return t(e.default.mark(function t() {
                var i, c;
                return e.default.wrap(function (e) {
                    for (; ;) switch (e.prev = e.next) {
                        case 0:
                            if (s.data.pageTag = r, 3 != o || 1 != a.need_password) {
                                e.next = 6;
                                break;
                            }
                            return e.next = 4, s.getPayKeyboardPassword();

                        case 4:
                            i = e.sent, s.getVerifyPassword(i, "noRect");

                        case 6:
                            3 == o && 1 != a.need_password ? wx.showModal({
                                title: "提示",
                                content: "支付成功",
                                showCancel: !1,
                                success: function (a) {
                                    if (a.confirm) {
                                        if ("circle" === r) try {
                                            var e = getCurrentPages();
                                            e[e.length - 2].updateView();
                                        } catch (a) {
                                            console.log(a);
                                        } else if ("groupWork" === r) return void wx.navigateTo({
                                            url: "/packageI/groupWork/groupWorkMy/groupWorkMy"
                                        });
                                        wx.navigateBack({
                                            delta: 1
                                        });
                                    }
                                }
                            }) : 1 == o || 55 == o ? s.WXPay_other(n.config) : 28 == o ? "成功" == n.msg ? (c = JSON.parse(n.data.rc_Result),
                                s.HJWXPay(c, "noRect")) : wx.showToast({
                                    title: n.msg,
                                    icon: "none"
                                }) : 82 == o ? s.OtherPay_sandWXpay() : 86 == o ? s.WXPay_other(n.data.pay_msg) : wx.showToast({
                                    title: "暂不支持该支付方式",
                                    icon: "none"
                                });

                        case 7:
                        case "end":
                            return e.stop();
                    }
                }, t);
            }))();
        },
        OtherPay_sandWXpay: function () {
            var a = this, e = r.getNetAddresss("order.merge-pay.sandpay-wechat");
            r._getNetWork({
                url: e,
                success: function (e) {
                    var t = e.data.pay_msg;
                    1 == t.result ? a.WXPay_other(t) : (wx.showToast({
                        title: t.msg,
                        icon: "none"
                    }), a.data.isPayClick = !1);
                },
                fail: function (a) {
                    console.log(a, "错误");
                }
            });
        },
        WXPay_other: function (a, e) {
            var t = this;
            wx.requestPayment({
                timeStamp: a.timestamp,
                nonceStr: a.nonceStr,
                package: a.package,
                signType: a.signType ? a.signType : "MD5",
                paySign: a.paySign,
                success: function (a) {
                    wx.showModal({
                        title: "提示",
                        content: "支付成功",
                        showCancel: !1,
                        success: function (a) {
                            if (a.confirm) {
                                if ("groupWork" == t.data.pageTag) return void wx.navigateTo({
                                    url: "/packageI/groupWork/groupWorkMy/groupWorkMy"
                                });
                                "back" === e && wx.navigateBack({
                                    delta: 1
                                });
                            }
                        }
                    });
                },
                fail: function (a) {
                    console.log(a), wx.showToast({
                        title: "支付失败请稍后重试",
                        icon: "none",
                        duration: 2e3
                    });
                }
            });
        },
        checkoutConsumePacket: function () {
            this.toRedirect();
        },
        payCallBack: function () {
            var a = this;
            if (1 != r.globalData.store_alone_temp) {
                var e = r.getNetAddresss("payment.callback-page.index");
                e += "&sn=" + this.data.order_sn, r._getNetWork({
                    url: e,
                    success: function (e) {
                        var t = e.data;
                        if (1 == t.result) try {
                            if ("groups" != a.data.name && "ywmGroup" != a.data.name || -1 == t.data.redirect.indexOf("group_detail")) wx.redirectTo({
                                url: t.data.min_redirect,
                                fail: function (a) {
                                    console.log(a), wx.reLaunch({
                                        url: "/packageG/index/index"
                                    });
                                }
                            }); else {
                                var o = redirect.match(/group_detail\/(\S*)\?i/)[1], n = (o = o.split("/"))[0];
                                URL = "/packageB/member/group/GroupDetail/GroupDetail?id=" + n, "ywmGroup" == a.data.name && (URL += "&plu=ywm"),
                                    o[1] ? wx.redirectTo({
                                        url: URL + "&store_id=" + o[1]
                                    }) : wx.redirectTo({
                                        url: URL
                                    });
                            }
                        } catch (a) {
                            wx.reLaunch({
                                url: "/packageG/index/index"
                            });
                        } else wx.reLaunch({
                            url: "/packageG/index/index"
                        });
                    },
                    fail: function (a) {
                        wx.reLaunch({
                            url: "/packageG/index/index"
                        }), console.log(a, "错误");
                    }
                });
            } else wx.reLaunch({
                url: "/packageG/independent_store/index/index?store_id=" + r.globalData.STORE_ID
            });
        },
        toRedirect: function () {
            this.data.is_cps ? wx.redirectTo({
                url: "/packageI/pay_back/pay_back?is_cps=" + this.data.is_cps + "&ids=" + this.data.order_pay_id
            }) : "Myshaky" != this.data.name && "blindBox" != this.data.name ? this.data.order_sn ? wx.redirectTo({
                url: "/packageI/pay_back/pay_back?ids=".concat(this.data.order_pay_id, "&sn=").concat(this.data.order_sn).concat(this.data.name ? "&name=" + this.data.name : "") + "&order_id_new=" + this.data.order_id
            }) : wx.redirectTo({
                url: "/packageI/pay_back/pay_back?ids=" + this.data.order_pay_id + "&name=" + this.data.name
            }) : wx.redirectTo({
                url: "/packageI/pay_back/pay_back?name=" + this.data.name + "&ids=" + this.data.order_pay_id + "&sn=" + this.data.order_sn
            });
            // Feilong.buyLog   Feilong.gdFenhong
            var a = this, e = r.getNetAddresss("Feilong.buyLog");
            r._getNetWork({
                url: e,
                data: {
                    uid:a.data.uid,
                    order_id:a.data.order_id,
                },
                success: function (e) {
                    console.log('zzzzzzzzzzzzzzz',e)
                },
                fail: function (a) {
                    console.log(a, "错误");
                }
            });
            var a = this, e = r.getNetAddresss("Feilong.gdFenhong");
            r._getNetWork({
                url: e,
                data: {
                    order_id:a.data.order_id,
                },
                success: function (e) {
                    console.log('zzzzzzzzzzzzzzz',e)
                },
                fail: function (a) {
                    console.log(a, "错误");
                }
            });
        },
        handlePay: function (a, o) {
            var n = this;
            return t(e.default.mark(function t() {
                var s;
                return e.default.wrap(function (e) {
                    for (; ;) switch (e.prev = e.next) {
                        case 0:
                            if (!n.data.isPayClick) {
                                e.next = 3;
                                break;
                            }
                            return r.tips("还在请求支付，请等待~"), e.abrupt("return");

                        case 3:
                            if (n.data.isPayClick = !0, 1 != o && 6 != o && 63 != o && 55 != o) {
                                e.next = 8;
                                break;
                            }
                            n.getWeChatPayParams(o), e.next = 20;
                            break;

                        case 8:
                            if (3 != o) {
                                e.next = 19;
                                break;
                            }
                            if (1 != a.need_password) {
                                e.next = 16;
                                break;
                            }
                            return e.next = 12, n.getPayKeyboardPassword();

                        case 12:
                            s = e.sent, n.getVerifyPassword(s), e.next = 17;
                            break;

                        case 16:
                            n.balancePay("");

                        case 17:
                            e.next = 20;
                            break;

                        case 19:
                            14 == o ? n.otherPay(a) : 11 == o || "cashPay" == o || 8 == o ? n.cashPay(o) : 16 == o ? n.transferAccounts() : 28 == o ? n.getWepayHj() : 17 == o ? n.payMoney() : 33 == o ? n.jueqiAlipay() : 48 == o ? n.wechatJsapiPay() : 54 == a ? n.sureBtn() : 59 == o ? n.quick_pay() : 75 == o ? n.huiju_wechat() : 77 == o ? (n.data.isPayClick = !1,
                                wx.redirectTo({
                                    url: "/packageH/superior_payment/superiorPaymentIndex/superiorPaymentIndex?order_id=" + JSON.parse(n.data.order_id).toString()
                                })) : 68 == o ? n.scancodeAccounts() : 78 == o ? n.xfpayWechat() : 80 == o ? n.storeBalance() : 82 == o ? n.sandpayWechat() : 83 == o ? n.lakalaWechat() : 86 == o ? n.Otherleshua() : 88 == o ? n.Throughpayment() : 98 == o ? n.silverUnionpay() : 102 == o ? n.eplusPay() : (wx.showToast({
                                    title: "暂不支持该支付方式",
                                    icon: "none"
                                }), n.data.isPayClick = !1);

                        case 20:
                        case "end":
                            return e.stop();
                    }
                }, t);
            }))();
        },
        otherPay: function (a) {
            this.data.isPayClick = !1, 2 == a.another_share_type ? wx.redirectTo({
                url: "/packageD/buy/payanother/payanother?order_id=" + JSON.parse(this.data.order_id).toString() + "&style=1"
            }) : wx.redirectTo({
                url: "/packageD/buy/payanother/payanother?order_id=" + JSON.parse(this.data.order_id).toString()
            });
        },
        eplusPay: function () {
            var a = this, e = r.getNetAddresss("order.merge-pay.eplusMiniPay");
            r._getNetWork({
                url: e,
                data: {
                    order_pay_id: this.data.order_pay_id
                },
                success: function (e) {
                    var t = e.data;
                    1 == t.result ? a.WXPay(t.data, "home") : wx.showModal({
                        content: t.msg,
                        showCancel: !1,
                        success: function () {
                            1 == t.data.eplus_bind_mobile ? wx.navigateTo({
                                url: "/packageF/others/wisdom/wisdomBind/wisdomBind?option=phone&to=pay"
                            }) : r.tips(t.msg);
                        }
                    });
                },
                fail: function (a) {
                    console.log(a, "错误");
                }
            });
        },
        silverUnionpay: function () {
            var a = this, e = r.getNetAddresss("plugin.love-speed-pool.frontend.pay.index");
            r._getNetWork({
                url: e,
                success: function (e) {
                    var t = e.data;
                    1 == e.result ? t.data.lengt > 0 ? wx.navigateTo({
                        url: "/packageF/silverPointPay/SilverPay/SilverPay?order_pay_id=" + a.data.order_pay_id
                    }) : wx.navigateTo({
                        url: "/packageF/silverPointPay/addSilverBank/addSilverBank?order_pay_id=" + a.data.order_pay_id
                    }) : wx.showToast({
                        title: e.msg,
                        icon: "none"
                    });
                },
                fail: function (a) {
                    console.log(a, "错误");
                }
            });
        },
        Throughpayment: function () {
            var a = this, e = r.getNetAddresss("plugin.love-speed-pool.frontend.pay.index");
            e += "&order_pay_id=" + this.data.order_pay_id, r._getNetWork({
                url: e,
                success: function (e) {
                    1 == (e = e.data).result ? (wx.showToast({
                        title: "支付成功",
                        icon: "none",
                        duration: 1e3
                    }), a.checkoutConsumePacket()) : wx.showToast({
                        title: e.msg,
                        icon: "none"
                    });
                },
                fail: function (a) {
                    console.log(a, "错误");
                }
            });
        },
        lakalaWechat: function () {
            var a = this;
            return t(e.default.mark(function t() {
                var o;
                return e.default.wrap(function (e) {
                    for (; ;) switch (e.prev = e.next) {
                        case 0:
                            o = r.getNetAddresss("order.merge-pay.lakala-wechat"), o += "&order_pay_id=" + a.data.order_pay_id,
                                r._getNetWork({
                                    url: o,
                                    success: function (e) {
                                        if (1 == (e = e.data).result) {
                                            var t = e.data.pay_msg;
                                            if (t) {
                                                var o = {
                                                    timeStamp: t.timeStamp,
                                                    nonceStr: t.nonceStr,
                                                    package: t.package,
                                                    signType: t.signType,
                                                    paySign: t.paySign
                                                };
                                                a.WXPay(o, "home");
                                            }
                                        } else wx.showToast({
                                            title: e.msg,
                                            icon: "none"
                                        });
                                    },
                                    fail: function (a) {
                                        console.log(a, "错误");
                                    }
                                });

                        case 3:
                        case "end":
                            return e.stop();
                    }
                }, t);
            }))();
        },
        sandpayWechat: function () {
            var a = this, e = r.getNetAddresss("order.merge-pay.sandpay-wechat");
            e += "&order_pay_id=" + this.data.order_pay_id, r._getNetWork({
                url: e,
                success: function (e) {
                    if (1 == (e = e.data).result) {
                        var t = e.data.pay_msg;
                        if (t) {
                            var o = {
                                timeStamp: t.timestamp,
                                nonceStr: t.nonceStr,
                                package: t.package,
                                signType: t.signType,
                                paySign: t.paySign
                            };
                            a.WXPay(o, "home");
                        }
                    } else wx.showToast({
                        title: e.msg,
                        icon: "none"
                    }), a.data.isPayClick = !1;
                },
                fail: function (a) {
                    console.log(a, "错误");
                }
            });
        },
        storeBalance: function () {
            var a = this, e = r.getNetAddresss("plugin.store-balance.frontend.pay.index");
            r._getNetWork({
                url: e,
                data: {
                    order_pay_id: this.data.order_pay_id,
                    store_id: this.data.store_id
                },
                success: function (e) {
                    var t = e.data;
                    1 == t.result ? wx.showToast({
                        title: t.msg,
                        icon: "none",
                        duration: 1e3,
                        complete: function () {
                            a.payCallBack();
                        }
                    }) : wx.showToast({
                        title: t.msg,
                        icon: "none",
                        duration: 1e3
                    });
                },
                fail: function (a) {
                    console.log(a);
                }
            });
        },
        getWeChatPayParams: function (a) {
            var e = this, t = 63 == a ? "plugin.store-aggregate-pay.frontend.aggregate-pay.wechat" : "order.merge-pay.wechatPay", o = r.getNetAddresss(t);
            o += "&order_pay_id=" + this.data.order_pay_id, o += "&client_type=2", 63 != a && this.data.senceKey && (o += "&senceKey=" + this.data.senceKey),
                this.data.mid && (o += "&mid=" + this.data.mid), this.data.pid && (o += "&pid=" + this.data.pid),
                r._getNetWork({
                    url: o,
                    success: function (t) {
                        if (0 == t.data.result && r.tips(t.data.msg), 63 != a) {
                            var o = t.data.data.config;
                            if (o) {
                                var n = {
                                    timeStamp: o.timestamp,
                                    nonceStr: o.nonceStr,
                                    package: o.package,
                                    signType: o.signType,
                                    paySign: o.paySign
                                };
                                o.orderInfo && !0 !== o.orderInfo ? wx.requestOrderPayment({
                                    timeStamp: n.timeStamp,
                                    nonceStr: n.nonceStr,
                                    package: n.package,
                                    signType: n.signType ? n.signType : "MD5",
                                    paySign: n.paySign,
                                    orderInfo: o.orderInfo,
                                    success: function (a) {
                                        e.toRedirect();
                                    },
                                    fail: function (a) {
                                        console.log(a);
                                    }
                                }) : "1177" == e.data.senceKey || "1175" == e.data.senceKey || "1176" == e.data.senceKey || "1195" == e.data.senceKey || "1191" == e.data.senceKey || o.orderInfo ? wx.requestOrderPayment({
                                    timeStamp: n.timeStamp,
                                    nonceStr: n.nonceStr,
                                    package: n.package,
                                    signType: n.signType ? n.signType : "MD5",
                                    paySign: n.paySign,
                                    success: function (a) {
                                        e.toRedirect();
                                    },
                                    fail: function (a) {
                                        console.log(a);
                                    }
                                }) : e.WXPay(n, t.data.data.redirect || "home", t.data.data.config.is_pay_manager);
                            }
                        } else wx.setClipboardData({
                            data: t.data.jsapi_pay_url,
                            success: function (a) {
                                wx.showToast({
                                    title: "已复制链接请用浏览器打开",
                                    icon: "none",
                                    duration: 5e3
                                });
                            },
                            fail: function () {
                                wx.showToast({
                                    title: "复制链接失败",
                                    icon: "none",
                                    duration: 2500
                                });
                            }
                        });
                        e.data.isPayClick = !1;
                    },
                    fail: function (a) {
                        e.data.isPayClick = !1;
                    }
                });
        },
        WXPay: function (a, e) {
            var t = this, n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0, s = r.getNetAddresss("order.mini-app.index"), i = this;
            o.default.info("----------WXPay>payParams 778-----------", a, e, n), 1 == n ? wx.requestOrderPayment({
                timeStamp: a.timeStamp,
                nonceStr: a.nonceStr,
                package: a.package,
                signType: a.signType ? a.signType : "MD5",
                paySign: a.paySign,
                success: function (t) {
                    i.WXPayChild(a, s, e);
                },
                fail: function (a) {
                    t.data.isPayClick = !1, wx.showToast({
                        title: "支付失败请稍后重试",
                        icon: "none",
                        duration: 2e3
                    }), o.default.info("----------WXPay>requestOrderPayment err-----------", a);
                }
            }) : wx.requestPayment({
                timeStamp: a.timeStamp,
                nonceStr: a.nonceStr,
                package: a.package,
                signType: a.signType ? a.signType : "MD5",
                paySign: a.paySign,
                success: function (t) {
                    i.WXPayChild(a, s, e);
                },
                fail: function (a) {
                    t.data.isPayClick = !1, wx.showToast({
                        title: "支付失败请稍后重试",
                        icon: "none",
                        duration: 2e3
                    }), o.default.info("----------WXPay>requestPayment err-----------", err);
                }
            });
        },
        WXPayChild: function (a, e, t) {
            var o = this, n = {
                formID: a.package.slice(10),
                orderId: this.data.order_id
            };
            r._postNetWork({
                url: e,
                showToastIn: !1,
                data: n,
                success: function (a) {
                    var e = a.data;
                    0 == e.result && wx.showToast({
                        icon: "none",
                        title: e.msg,
                        duration: 1500
                    }), t ? (o.setData({
                        cbHref: {
                            cbHref: t
                        }
                    }), o.checkoutConsumePacket()) : wx.navigateBack({
                        delta: 1
                    });
                }
            });
        },
        payKeyboardComplete: function (a) {
            this.setData({
                popupSpecs: !1
            }), n.payKeyboardAsync.complete(a.detail);
        },
        getPayKeyboardPassword: function () {
            return this.setData({
                popupSpecs: !0
            }), new Promise(function (a, e) {
                n.payKeyboardAsync.addCompleteFn(function (e) {
                    a(e);
                });
            });
        },
        payKeyboardClose: function () {
            this.setData({
                popupSpecs: !1
            }), this.data.isPayClick = !1;
        },
        getVerifyPassword: function (a, e) {
            var t = this, o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "", n = r.getNetAddresss("payment.password.check");
            n += "&password=" + a, r._getNetWork({
                url: n,
                success: function (n) {
                    var r = n.data;
                    if (1 == r.result) if ("noRect" === e) wx.showToast({
                        icon: "none",
                        title: "支付成功",
                        duration: 2e3
                    }); else {
                        if ("tourAround" === e) return void t.balancePay(a, "tourAround", o);
                        t.balancePay(a);
                    } else t.data.isPayClick = !1, t.verifyPasswordError(r);
                },
                fail: function (a) {
                    console.log(a);
                }
            });
        },
        verifyPasswordError: function (a) {
            wx.showModal({
                title: "提示",
                content: a.msg,
                success: function (e) {
                    e.confirm ? 2001 == a.data.code || (2002 == a.data.code ? wx.navigateTo({
                        url: "/packageA/member/set_balance_password/set_balance_password"
                    }) : a.data.code) : e.cancel && (2001 == a.data.code || 2002 == a.data.code || a.data.code);
                }
            });
        },
        balancePay: function (a) {
            var e = this, t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "", o = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "";
            if (console.log(t), "tourAround" == t) {
                var n = {
                    order_sn: this.data.order_sn,
                    pay_type: o
                };
                return r._isTextEmpty(a) || (n = {
                    order_sn: this.data.order_sn,
                    payment_password: a,
                    pay_type: o
                }), void this.troundOrdinary(n, t);
            }
            var s = r.getNetAddresss("order.credit-merge-pay.credit2");
            s += "&order_pay_id=" + this.data.order_pay_id, r._isTextEmpty(a) || (s += "&payment_password=" + a),
                this.data.pid && (s += "&pid=" + this.data.pid), r._getNetWork({
                    url: s,
                    success: function (a) {
                        1 == a.data.result ? (e.setData({
                            redirectData: a.data,
                            cbHref: {}
                        }), e.checkoutConsumePacket()) : wx.showToast({
                            title: a.data.msg,
                            icon: "none",
                            duration: 2e3
                        }), setTimeout(function () {
                            e.data.isPayClick = !1;
                        }, 2e3);
                    }
                });
        },
        troundOrdinary: function (a, e) {
            var t = this, o = r.getNetAddresss("plugin.travel-around.frontend.payment.payment.pay");
            r._getNetWork({
                url: o,
                data: a,
                success: function (a) {
                    1 == a.data.result ? wx.redirectTo({
                        url: "/packageI/pay_back/pay_back?name=".concat(e, "&ids=").concat(t.data.order_pay_id, "&sn=").concat(t.data.order_sn)
                    }) : (wx.showToast({
                        title: a.data.msg,
                        icon: "success",
                        duration: 2e3
                    }), console.log("错误", a.data.msg));
                }
            });
        },
        cashPay: function (a) {
            var e = this;
            if ("8" == a) {
                var t = r.getNetAddresss("plugin.store-cashier.frontend.payment.cashPay.cashPay");
                return t += "&client_type=2&order_pay_id=" + this.data.order_pay_id, this.data.mid && (t += "&mid=" + this.data.mid),
                    void r._getNetWork({
                        url: t,
                        success: function (a) {
                            1 == (a = a.data).result ? wx.showModal({
                                title: "提示",
                                content: a.msg,
                                showCancel: !1,
                                success: function (a) {
                                    a.confirm && wx.reLaunch({
                                        url: "/packageG/member_v2/member_v2"
                                    });
                                }
                            }) : (wx.showToast({
                                title: a.msg,
                                icon: "none"
                            }), e.data.isPayClick = !1);
                        },
                        fail: function (a) {
                            console.log(a, "错误");
                        }
                    });
            }
            wx.redirectTo({
                url: "/packageA/member/order/orderCash/orderCash?order_pay_id=" + this.data.order_pay_id + "&pid=" + (this.data.pid ? this.data.pid : this.data.uid)
            }), this.data.isPayClick = !1;
        },
        transferAccounts: function () {
            wx.redirectTo({
                url: "/packageA/member/order/TransferAccount/TransferAccount?id=" + this.data.order_pay_id + "&order_ids=" + this.data.order_id + "&status=" + this.data.status
            }), this.data.isPayClick = !1;
        },
        getWepayHj: function () {
            var a = this, e = r.getNetAddresss("order.merge-pay.wechat-pay-hj");
            e += "&client_type=2&order_pay_id=" + this.data.order_pay_id, this.data.mid && (e += "&mid=" + this.data.mid),
                this.data.pid && (e += "&pid=" + this.data.pid), r._getNetWork({
                    url: e,
                    success: function (e) {
                        if (1 == (e = e.data).result) {
                            var t = JSON.parse(e.data.data.rc_Result);
                            a.HJWXPay(t);
                        } else wx.showToast({
                            title: e.msg,
                            icon: "none"
                        }), a.data.isPayClick = !1;
                    },
                    fail: function (a) {
                        console.log(a, "错误");
                    }
                });
        },
        HJWXPay: function (a, e) {
            var t = this;
            wx.requestPayment({
                appId: a.appId,
                timeStamp: a.timeStamp,
                nonceStr: a.nonceStr,
                package: a.package,
                signType: a.signType,
                paySign: a.paySign,
                success: function (a) {
                    wx.showToast({
                        title: "支付成功",
                        icon: "success",
                        duration: 2e3,
                        success: function () {
                            setTimeout(function () {
                                "groupWork" != t.data.pageTag ? "noRect" === e ? wx.navigateBack({
                                    delta: 1,
                                    fail: function () {
                                        wx.reLaunch({
                                            url: "/packageG/index/index"
                                        });
                                    }
                                }) : (t.setData({
                                    redirectData: {},
                                    cbHref: {}
                                }), t.checkoutConsumePacket()) : wx.navigateTo({
                                    url: "/packageI/groupWork/groupWorkMy/groupWorkMy"
                                });
                            }, 2e3);
                        }
                    });
                },
                fail: function (e) {
                    console.log(e), console.log(a, "参数"), wx.showToast({
                        title: "支付失败请稍后重试",
                        icon: "none",
                        duration: 2e3
                    });
                }
            }), this.data.isPayClick = !1;
        },
        payMoney: function () {
            var a = this, e = {
                order_pay_id: this.data.order_pay_id
            }, t = r.getNetAddresss("order.mergePay.COD");
            r._getNetWork({
                url: t,
                data: e,
                success: function (e) {
                    var t = e.data;
                    1 == t.result ? (a.setData({
                        redirectData: t,
                        cbHref: {}
                    }), a.checkoutConsumePacket()) : (wx.showToast({
                        icon: "none",
                        title: t.msg,
                        duration: 2e3
                    }), a.data.isPayClick = !1);
                },
                fail: function (a) {
                    console.log(a);
                }
            });
        },
        rechargePay_quick_pay: function (a, e) {
            var t = this, o = 3, n = r.getNetAddresss("plugin.converge_pay.frontend.controllers.quick-pay.love-recharge");
            "balance" === e ? (o = 2, n = r.getNetAddresss("plugin.converge_pay.frontend.controllers.quick-pay.show-recharge")) : "recharge" === e ? (o = 1,
                n = r.getNetAddresss("plugin.converge_pay.frontend.controllers.quick-pay.credit-recharge")) : "tourAroundPay" === e && (o = 4,
                    n = r.getNetAddresss("plugin.converge_pay.frontend.controllers.quick-pay.travelAround")),
                r._getNetWork({
                    url: n,
                    data: {
                        ordersn: a
                    },
                    success: function (e) {
                        t.data.isPayClick = !1, 1 == e.data.result ? 0 == e.data.data.have_bank_card ? wx.navigateTo({
                            url: "/packageD/quickPay/add_bank_first/add_bank_first?order_pay_id=" + a + "&status=" + o
                        }) : wx.navigateTo({
                            url: "/packageD/quickPay/choose_bank/choose_bank?order_pay_id=" + a + "&status=" + o
                        }) : wx.showToast({
                            title: e.data.msg,
                            duration: 1e3,
                            icon: "none"
                        });
                    },
                    fail: function (a) {
                        console.log(a);
                    }
                });
        },
        jueqiAlipay: function (a) {
            var e = this, t = r.getNetAddresss("order.merge-pay.wechat-pay-jueqi");
            t += a ? "&order_pay_id=" + a : "&order_pay_id=" + this.data.order_pay_id, this.data.pid && (t += "&pid=" + this.data.pid),
                r._getNetWork({
                    url: t,
                    success: function (a) {
                        var t = a.data;
                        1 == t.result ? e.HJWXPay(t.data) : (wx.showToast({
                            title: t.msg,
                            icon: "none"
                        }), e.data.isPayClick = !1);
                    },
                    fail: function (a) {
                        console.log(a, "错误");
                    }
                });
        },
        wechatJsapiPay: function () {
            var a = this, e = r.getNetAddresss("order.merge-pay.wechat-jsapi-pay");
            e += "&order_pay_id=" + this.data.order_pay_id, this.data.pid && (e += "&pid=" + this.data.pid),
                this.data.store_id && (e += "&store_id=" + this.data.store_id), r._getNetWork({
                    url: e,
                    success: function (e) {
                        var t = e.data;
                        1 == t.result ? a.HJWXPay(t.data.config) : (wx.showToast({
                            title: t.msg,
                            icon: "none"
                        }), a.data.isPayClick = !1);
                    },
                    fail: function (a) {
                        console.log(a, "错误");
                    }
                });
        },
        quick_pay: function () {
            var a = this, e = r.getNetAddresss("plugin.converge_pay.frontend.controllers.quick-pay.pay");
            this.data.pid && (e += "&pid=" + this.data.pid), r._getNetWork({
                url: e,
                data: {
                    order_pay_id: this.data.order_pay_id
                },
                success: function (e) {
                    a.data.isPayClick = !1, 1 == e.data.result ? 0 == e.data.data.have_bank_card ? wx.navigateTo({
                        url: "/packageD/quickPay/add_bank_first/add_bank_first?order_pay_id=" + a.data.order_pay_id
                    }) : wx.navigateTo({
                        url: "/packageD/quickPay/choose_bank/choose_bank?order_pay_id=" + a.data.order_pay_id
                    }) : wx.showToast({
                        title: e.data.msg,
                        duration: 1e3,
                        icon: "none"
                    });
                },
                fail: function (a) {
                    console.log(a);
                }
            });
        },
        huiju_wechat: function () {
            var a = this, e = r.getNetAddresss("plugin.converge-alloc-funds.frontend.controllers.converge-separate.pay");
            e += "&order_pay_id=" + this.data.order_pay_id, this.data.pid && (e += "&pid=" + this.data.pid),
                r._getNetWork({
                    url: e,
                    success: function (e) {
                        if (1 == (e = e.data).result) {
                            var t = JSON.parse(e.data.rc_Result);
                            a.HJWXPay(t);
                        } else wx.showToast({
                            title: e.msg,
                            icon: "none"
                        }), a.data.isPayClick = !1;
                    },
                    fail: function (a) {
                        console.log(a, "错误");
                    }
                });
        },
        scancodeAccounts: function () {
            wx.redirectTo({
                url: "/packageA/member/order/scancodeAccount/scancodeAccount?id=" + this.data.order_pay_id + "&order_ids=" + this.data.order_id + "&status=" + this.data.status
            }), this.data.isPayClick = !1;
        },
        sureBtn: function () {
            var a = this, e = r.getNetAddresss("order.merge-pay.confirm-pay");
            e += "&order_pay_id=" + this.data.order_pay_id, this.data.pid && (e += "&pid=" + this.data.pid),
                r._getNetWork({
                    url: e,
                    success: function (e) {
                        var t = e.data;
                        1 == t.result ? a.checkoutConsumePacket() : (a.data.isPayClick = !1, wx.showToast({
                            title: t.msg,
                            icon: "none",
                            duration: 2e3
                        }));
                    },
                    fail: function (a) {
                        console.log(a, "错误");
                    }
                });
        },
        xfpayWechat: function () {
            var a = this, e = r.getNetAddresss("order.merge-pay.xfpay-wechat");
            e += "&order_pay_id=" + this.data.order_pay_id, r._getNetWork({
                url: e,
                success: function (e) {
                    1 == (e = e.data).result ? e.data.pay_msg && e.data.pay_msg.js_prepay_info ? a.HJWXPay(e.data.pay_msg.js_prepay_info) : (wx.showToast({
                        title: "第三方支付预付单信息为空，请选择其他支付方式！",
                        icon: "none",
                        duration: 2500
                    }), a.data.isPayClick = !1) : (wx.showToast({
                        title: e.msg,
                        icon: "none"
                    }), a.data.isPayClick = !1);
                },
                fail: function (a) {
                    console.log(a, "错误");
                }
            });
        },
        Otherleshua: function () {
            var a = this, e = r.getNetAddresss("order.merge-pay.leshua-wechat");
            this.data.order_pay_id && (e += "&order_pay_id=" + this.data.order_pay_id), r._getNetWork({
                url: e,
                success: function (e) {
                    if (1 == (e = e.data).result) {
                        var t = e.data.pay_msg;
                        if (t) {
                            var o = {
                                timeStamp: t.timeStamp,
                                nonceStr: t.nonceStr,
                                package: t.package,
                                signType: t.signType,
                                paySign: t.paySign
                            };
                            a.WXPay(o, "home");
                        }
                    } else wx.showToast({
                        title: e.msg,
                        icon: "none"
                    });
                },
                fail: function (a) {
                    console.log(a, "错误");
                }
            });
        }
    }
});